<!--
  @author heguanghua
  @since 2020/06/11 14:21
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head th:include="common/common::jscss"/>
<style>
    .layui-form.ew-tree-table { margin-bottom: 0; }
    .ew-tree-table-cell-content { padding: 3px 5px !important; }
    .layui-form-checkbox[lay-skin=primary] { padding-left: 22px; }
</style>
<body>

<div class="layui-fluid"
     th:with="hasDetail=${#authPermit.checkPermit('/dept/detail.action')},
     hasDpermitOrganizeList=${#authPermit.checkPermit('/dept/dpermit/organize/tree.action')},
     hasDpermitDeptList=${#authPermit.checkPermit('/dept/dpermit/dept/tree.action')},
     hasDpermitAreaList=${#authPermit.checkPermit('/dept/dpermit/area/tree.action')},
     hasDpermitChannelList=${#authPermit.checkPermit('/dept/dpermit/channel/tree.action')},
     hasDpermitProductList=${#authPermit.checkPermit('/dept/dpermit/product/tree.action')},
     hasDpermitCubeList=${#authPermit.checkPermit('/dept/dpermit/cube/tree.action')},
     hasDpermitMeasureList=${#authPermit.checkPermit('/dept/dpermit/measure/tree.action')},
     hasDpermitAccountList=${#authPermit.checkPermit('/dept/dpermit/account/tree.action')},
     hasDpermitNewChannelList=${#authPermit.checkPermit('/dept/dpermit/newchannel/tree.action')},
     hasDpermitAssign=${#authPermit.checkPermit('/dept/dpermit/modify/dept/assign.action') && isAssignAdmin},
     hasDpermitClear=${#authPermit.checkPermit('/dept/dpermit/modify/dept/clear.action') && isAssignAdmin}">

    <blockquote class="layui-crumb">
        <a th:lay-href="|${SYS_MCC}/organize/tree.action|" lay-text="组织架构">组织架构管理</a>&nbsp;&nbsp;>&nbsp;
        <a th:lay-href="|${SYS_MCC}/organize/detail.action?orgId=${organize.orgId}|" th:lay-text="组织信息" th:text="${organize.orgName}">组织信息</a>&nbsp;&nbsp;>
        <a th:lay-href="|${SYS_MCC}/dept/tree.action?orgId=${obj.orgId}|" lay-text="部门管理">部门管理</a>&nbsp;&nbsp;>&nbsp;
        <a th:lay-href="|${SYS_MCC}/dept/detail.action?deptId=${obj.deptId}|" th:lay-text="部门信息" th:text="${obj.deptName}">部门信息</a>&nbsp;&nbsp;>
        区域数据权限
    </blockquote>

    <div class="layui-card">

        <div class="layui-tab layui-tab-brief">
            <ul class="layui-tab-title">
                <li th:if="${hasDpermitOrganizeList}"><a th:lay-href="|${SYS_MCC}/dept/dpermit/organize/tree.action?deptId=${obj.deptId}|" lay-text="组织权限">组织权限</a></li>
                <li class="layui-this" th:if="${hasDpermitDeptList}"><a th:lay-href="|${SYS_MCC}/dept/dpermit/dept/tree.action?deptId=${obj.deptId}|" lay-text="部门权限">部门权限</a></li>
                <li th:if="${hasDpermitAreaList}"><a th:lay-href="|${SYS_MCC}/dept/dpermit/area/tree.action?deptId=${obj.deptId}|" lay-text="区域权限">区域权限</a></li>
                <li th:if="${hasDpermitChannelList}"><a th:lay-href="|${SYS_MCC}/dept/dpermit/channel/tree.action?deptId=${obj.deptId}|" lay-text="合作权限">合作权限</a></li>
                <li th:if="${hasDpermitNewChannelList}"><a th:lay-href="|${SYS_MCC}/dept/dpermit/newchannel/tree.action?deptId=${obj.deptId}|" lay-text="渠道权限">渠道权限</a></li>
                <li th:if="${hasDpermitAccountList}"><a th:lay-href="|${SYS_MCC}/dept/dpermit/account/tree.action?deptId=${obj.deptId}|" lay-text="推广权限">推广权限</a></li>
                <li th:if="${hasDpermitProductList}"><a th:lay-href="|${SYS_MCC}/dept/dpermit/product/tree.action?deptId=${obj.deptId}|" lay-text="产品权限">产品权限</a></li>
                <li th:if="${hasDpermitCubeList}"><a th:lay-href="|${SYS_MCC}/dept/dpermit/cube/tree.action?deptId=${obj.deptId}|" lay-text="大数据报表权限">大数据报表权限</a></li>
                <li th:if="${hasDpermitMeasureList}"><a th:lay-href="|${SYS_MCC}/dept/dpermit/measure/tree.action?deptId=${obj.deptId}|" lay-text="大数据指标权限">大数据指标权限</a></li>
            </ul>
        </div>

        <div class="layui-card-body">

            <blockquote class="layui-elem-quote layui-quote-nm">
                1、部门数据权限不能随意更改，只有具备"系统全局角色"的操作人才能修改；<br/>
                2、员工如未分配部门数据权限，则继承部门的数据权限；<br/>
                3、<b>分配上级部门权限后，如未分配任一下级部门，则默认具有其所有的下级部门权限，如继续分配其下级部门，则只具备指定的下级部门权限。</b>
            </blockquote>

            <table class="layui-hide" id="zmn-table" lay-filter="zmn-table"></table>

            <script type="text/html" id="zmn-table-tool">
                <button class="layui-btn layui-btn-sm" lay-event="assign" th:if="${hasDpermitAssign}">授权选中部门</button>
                <button class="layui-btn layui-btn-sm" lay-event="clear" th:if="${hasDpermitClear}">清除全部</button>
            </script>

        </div>

    </div>

</div>
</body>
</html>

<script type="text/javascript" th:inline="javascript">

    var json = {
        deptId: [[${obj.deptId == null ? 0: obj.deptId}]]
    };

    layui.extend({
        dept_dpermit_dept_tree: "dept/zmn.dept.dpermit.dept.tree",
        treeTable2: "treeTable-3.x"
    }).use(['index', 'dept_dpermit_dept_tree']);

</script>
